package key.w8.boot.listener;

import key.w8.boot.service.ServiceFactory;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

/**
 * @Author: k8
 * @CreateTime: 2025-08-17
 * @Version: 1.0
 */
public class ApplicationStartListener implements ApplicationListener<ApplicationStartedEvent> {
    private final ServiceFactory serviceFactory;

    public ApplicationStartListener(ServiceFactory serviceFactory) {
        this.serviceFactory = serviceFactory;
    }

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        serviceFactory.init();
    }
}
